fix: address PR #11798 feedback on rooignore enforcement (#11797)#11799
Closed
roomote[bot] wants to merge 2 commits intofix/rooignore-enforcement-11797from
Closed
fix: address PR #11798 feedback on rooignore enforcement (#11797)#11799roomote[bot] wants to merge 2 commits intofix/rooignore-enforcement-11797from
roomote[bot] wants to merge 2 commits intofix/rooignore-enforcement-11797from
Conversation
…file listing - Harden validateAccess() to fall back to original path when realpath resolves outside cwd (fixes submodule/symlink bypass) - Change error handling in validateAccess() to fail closed (deny access) instead of fail open - Add .rooignore post-filtering in CodebaseSearchTool to exclude ignored files from search results even if they were previously indexed - Pass RooIgnoreController from manager through service-factory to scanner so the scanner reuses the workspace-root controller instead of creating its own from the scan directory - Add tests for realpath-outside-cwd fallback, fail-closed error handling, and CodebaseSearchTool rooignore filtering Fixes #11797
1. FileWatcher: initialize fallback RooIgnoreController in initialize() so .rooignore rules load even when manager controller is not passed. Added ignoreControllerIsOwned flag to track ownership. 2. validateAccess: update security spec tests to expect denial for paths outside cwd, matching the new fail-closed behavior. 3. Scanner: add passthrough test verifying that provided controller is used (and not re-initialized) vs fallback creation. 4. CodebaseSearchTool: add clarifying comment on guard clause that drops payload-less entries (structural no-op, not ignore decision).
91f662a to
ba42cbd
Compare
Contributor
Author
|
Closing this PR - changes have been squashed into a single commit on PR #11798 as requested. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related GitHub Issue
Closes: #11797
This PR attempts to address the feedback from @frbrdan-code on PR #11798.
Description
Addresses all 4 review comments on the rooignore enforcement PR:
FileWatcher cwd mismatch (Comment 1): The
FileWatcherfallbacknew RooIgnoreController(workspacePath)was never initialized, meaning.rooignorepatterns would not load for incremental re-indexing when the manager's controller was not passed. AddedignoreControllerIsOwnedflag andinitialize()call for the fallback path.validateAccess behavior change for outside-cwd paths (Comment 2): Updated security spec tests to expect
false(denial) for paths outside cwd, matching the new fail-closed behavior. Spot-checked all callers -- they pass relative or within-cwd paths, so the behavior change is safe.Scanner controller passthrough test (Comment 3): Added two tests: one verifying the provided
RooIgnoreControlleris used (and not re-initialized), another verifying fallback creation and initialization when none is provided.filteredResults guard clause clarity (Comment 4): Added clarifying comment that the
!result.payloadcheck is a structural guard clause, not an ignore decision.Test Procedure
cd src && npx vitest run core/ignore/__tests__/RooIgnoreController.security.spec.ts-- 11 passedcd src && npx vitest run core/ignore/__tests__/RooIgnoreController.spec.ts-- 24 passedcd src && npx vitest run services/code-index/processors/__tests__/scanner.spec.ts-- 12 passedcd src && npx vitest run core/tools/__tests__/codebaseSearchTool.spec.ts-- 3 passedPre-Submission Checklist
Documentation Updates
Additional Notes
Feedback and guidance are welcome.
Interactively review PR in Roo Code Cloud